<script src="./public/layui/layui.js"></script>


<script>
    layui.use(function () {
        $ = layui.$
        var layer = layui.layer
        $('#vip').click(() => {
            layer.prompt({ title: '请输入卡密', formType: 0 }, function (pass, index) {
                layer.close(index);
                $.get('?p=index&c=fake&a=use', { fake: pass }, (res) => {
                    layer.msg(res.msg)
                })
            });
        })
        $('#feedback').click(() => {
            layer.prompt({ title: '请输入反馈内容', formType: 2 }, function (pass, index) {
                layer.close(index);
                $.post('?p=index&c=feedback&a=add', { content: pass }, (res) => {
                    if (res.code == 200) {
                        layer.msg('反馈成功')
                    } else {
                        layer.msg(res.msg)
                    }
                })
            });
        })
        $('#account').click(() => {
            layer.open({
                type: 2
                , area: ['80%', '80%']
                , content: '?p=index&c=account&a=index'
            })
        })
        $('#logout').click(() => {
            $.get('?p=index&c=login&a=logout', (res) => {
                if (res.code == 200) {
                    layer.msg('退出成功')
                    setTimeout(() => {
                        window.location.href = '?p=index&c=login'
                    }, 2000)
                }
            })

        })
    })
</script>